<template>
    <div>
        <table>
            <tr>
                <td>门店名称</td>
                <td>
                    <input type="text" v-model="h.Yname">
                </td>
            </tr>
               <tr>
                <td>门店地址</td>
                <td>
                     <input type="text" v-model="h.Ydz">
                </td>
            </tr>
               <tr>
                <td>门店联系方式</td>
                <td>
                     <input type="text" v-model="h.Ylxfs">
                </td>
            </tr>
               <tr>
                <td>门店状态</td>
                <td>
                     <input type="text" v-model="h.Yzt">
                </td>
            </tr>
               <tr>
                <td></td>
                <td>
                    <input type="button" value="添加" @click="add">
                </td>
            </tr>
        </table>
    </div>
</template>

<script setup lang="ts">

import axios from 'axios';
import {ref,onMounted} from 'vue';

const h = ref({
    "Yid": 1,
    "Yname": "",
    "Ydz": "",
    "Ylxfs": "",
    "Yzt": ""
})

const add=()=>{
    axios.post("https://localhost:7119/api/ZK/Add",h.value).then(res=>{
        if(res.data>0){
            alert("添加成功!");
        }
        else{
             alert("添加失败!");
        }
    })
}
</script>

<style scoped>

</style>